<?php
/**
 * Created by PhpStorm
 * User: 龍zero
 * Date: 2022-05-16
 * Time: 14:18
 */
declare(strict_types=1);

namespace App\Request\Business;

use Hyperf\Validation\Request\FormRequest;
class BusinessRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'category_id' => 'required|positive',
            'name' => 'required|between:2,60',
            'phone' => 'required|max:15',
            'bus_hours' => 'max:50',
            'address' => 'required|between:2,255',
            'longitude' => 'max:60',
            'latitude' => 'max:60',
            'mchnt_cd' => 'required|min:6|max:20',
            'logo_img_id' => 'positive',
            'describe' => 'string|nullable',
            'show_imgs' => 'array',
            'show_imgs.*.img_id' => 'required|positive',
            'show_imgs.*.index' => 'integer',
        ];
    }
}